from typing import List


class Solution:
    def canBeIncreasing(self, nums: List[int]) -> bool:
        n0 = 0
        n1 = 0
        for num in nums:
            if num > n1:
                n1 = num
            else:
                n1 = 1001

            n1 = min(n1, n0)

            if num > n0:
                n0 = num
            else:
                n0 = 1001

        return n1 < 1001


if __name__ == "__main__":
    print(Solution().canBeIncreasing([1, 2, 10, 5, 7]))  # True
    print(Solution().canBeIncreasing([2, 3, 1, 2]))  # False
    print(Solution().canBeIncreasing([1, 1, 1]))  # False
    print(Solution().canBeIncreasing([1, 2, 3]))  # True
